<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>Term of Service</title>
  <link rel="stylesheet" href="../default.css" />
</head>
<%
UserService userSvc = UserServiceFactory.getUserService();
User currentUser = userSvc.getCurrentUser();
String userName = "";
if (currentUser != null)
{
	userName = currentUser.getNickname();
}
else
{
	String loginUrl = userSvc.createLoginURL("../index.action");
	response.sendRedirect(loginUrl);
}
String logoutUrl = userSvc.createLogoutURL("../index.action");
%>
<body>
    <div id="main">
      <div id="content">
        <div id="login">
          <div id="login-left">Welcome <%= userName %></div>
          <div id="login-right"><a href="<%= logoutUrl%>">Logout</a></div>
        </div>
        <div id="block">
          <h1>Code Snippet Repository</h1>
          <h3>Term of Agreement</h3>
        </div>
        <div id="strip"></div>
        <div id="block">
	      <h3>Privacy</h3>
	      <p>We only collect minimum amount of your personal information, your user name. And we don't share the info we collected
	      to any one.</p>
	      <h3>Copy Rights</h3>
	      <p>We assume that the code snippets you have submitted belongs to you or whatever the source you have obtained from. We
	      do not claim the copy rights of any code snippets, unless we explicitly claim that we hold the copy rights. Please be aware
	      of this fact.</p>
	      <h3>Liability</h3>
	      <p>We do not assume any responsibility of the copy rights violation of our user. We only provide a convenient service to our
	      users, and do not own any copy rights of code snippets submitted by our users. So we are not liable for any wrong doing of
	      our users. Please be aware of this fact.</p>
	      <h3>Moderation</h3>
	      <p>We will respond to any complaints promptly. After detailed examination of the complaints from all involved parties, we
	      will take appropriate actions. Which including the following:</p>
	      <ul>
	        <li>Removing the code snippets that violate copy rights.</li>
	        <li>Removing users that are involved in any proven wrong doing.</li>
	      </ul>
	      <p>
	      <b>By registering and use our service, you are agree to our term of service. Thank you.</b>
	      </p>
        </div>
        <div id="strip"></div>
        <div id="block">
          <s:form action="SaveUserRegistration.action">
          <s:checkbox label="I Agree" name="agreeToTerm" value="aBoolean" fieldValue="true"/>
          <s:submit/>
          </s:form>
        </div>
      </div>
    </div>
</body>
</html>